import request from '@/utils/request'

// 查询客户信息列表
export function listCustomer(query) {
  return request({
    url: '/customer/list',
    method: 'get',
    params: query
  })
}

// 查询客户信息列表
export function queryInfoList(query) {
  return request({
    url: '/customer/queryInfoList',
    method: 'get',
    params: query
  })
}

// 查询客户信息详细
export function getCustomer(id) {
  return request({
    url: '/customer/' + id,
    method: 'get'
  })
}

// 新增客户信息
export function addCustomer(data) {
  return request({
    url: '/customer',
    method: 'post',
    data: data
  })
}

// 修改客户信息
export function updateCustomer(data) {
  return request({
    url: '/customer',
    method: 'put',
    data: data
  })
}

// 删除客户信息
export function delCustomer(id) {
  return request({
    url: '/customer/' + id,
    method: 'delete'
  })
}

// 加载父节点
export function loadParentOrg(parentId) {
  return request({
    url: '/region/getRegion/' + parentId,
    method: 'get'
  })
}

// 加载org
export function loadOrg(orgId) {
  return request({
    url: '/region/getRegionByCode/' + orgId,
    method: 'get'
  })
}

// 我的客户退回
export function customerReturnPool(data) {
  return request({
    url: '/customer/customerReturnPool',
    method: 'post',
    data: data
  })
}

/** 拉取上级客户 */
export function customerPoolPull(data) {
  return request({
    url: '/customer/customerPoolPull',
    method: 'post',
    data: data
  })
}

// 客户确认
export function customerRL(query) {
  return request({
    url: '/customer/customerRL/' + query,
    method: 'get'
  })
}

// 保存记录信息
export function saveBz(data) {
  return request({
    url: '/customer/saveBz',
    method: 'post',
    data: data
  })
}

// 明细信息
export function getMxInfo(id) {
  return request({
    url: '/customer/getMxInfo/' + id,
    method: 'get',
  })
}

// 查询记录信息
export function getRecordList(id) {
  return request({
    url: '/customer/record/' + id,
    method: 'get',
  })
}

// 设置重要客户
export function setVip(id, type) {
  return request({
    url: '/customer/setVip/' + id + '/' + type,
    method: 'get',
  })
}

// 获取提醒
export function getCustomerStar(type) {
  return request({
    url: '/customer/getCustomerStar/' + type,
    method: 'get',
  })
}

// 邀约
export function invite(id) {
  return request({
    url: '/customer/invite/' + id,
    method: 'get',
  })
}

// 上门
export function upDoor(id) {
  return request({
    url: '/customer/upDoor/' + id,
    method: 'get',
  })
}

// 下推
export function pushCustomer(id) {
  return request({
    url: '/customer/pushCustomer/' + id,
    method: 'get',
  })
}

// 下推记录查看
export function pushCustomerRecord(id) {
  return request({
    url: '/customer/pushCustomer/record/' + id,
    method: 'get',
  })
}

// 退回记录查看
export function returnCustomerRecord(id) {
  return request({
    url: '/customer/returnCustomer/record/' + id,
    method: 'get',
  })
}

// 推送分配
export function pusDis(data) {
  return request({
    url: '/customer/pushCustomer/pusDis',
    method: 'post',
    data: data
  })
}

// 下推退回客户
export function pushReturnCustomer(data) {
  return request({
    url: '/customer/pushCustomer/return',
    method: 'post',
    data: data
  })
}




